home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Technotools
/
Technotools (Chestnut CD-ROM)(1993).ISO
/
misc_pto
/
objdumpf
/
objdump.doc
next >
Wrap
Text File
|
1988-09-18
|
14KB
|
397 lines
ONCE IN A BLUE MOON SOFTWARE'S
OBJECT FILE DUMP FACILITY
COPYWRITE 1988
This program is released to the public domain by the author.
This software is designed to perform on IBM PCs, XTs, ATs,
PS/2s1, and their clones. However, No guarantees, expressed or
implied are made. You may make as many copies of the program as
you like and distribute them as you see fit. You may not alter
the program or its documentation. Nor may you charge any fees
for distributing or using this software.
____________________
1 IBM, PC/AT, and PS/2 are registered trademarks of International
Business Machines Corporation.
Once in a Blue Moon Software's Object File Dump Facility -1-
PURPOSE
The object file dump facility is a programmer's tool designed to
display Intel/Microsoft2 compatible object files. It is assumed
that you are somewhat familiar with object file format and
assembly language. A few basics of the format are discussed
here. For additional information on the object file format
consult Intel/Microsoft documentation.
HOW TO RUN OBJDUMP
Start the object file dump facility by entering the executable
file name and optionally a complete or partial file specification
on the DOS command line:
C:\>OBJDUMP [drivespec:] [\path] [\filespec]
Where drivespec is a valid drive such as C:, path is any valid
pathname and filespec is a full file name or a partial filename
such as *.obj. For example, if you wanted to dump an object file
named myobj.obj in the masm directory, you would enter:
C:\>OBJDUMP C:\MASM\MYOBJ <Ret>
To select from all of the object files in the masm directory you
would type:
C:\>OBJDUMP C:\MASM\*.OBJ <Ret>
If you don't specify anything on the command line, the current
drive and directory and the default file specification ,*.OBJ,
will be assumed.
The screen will clear and the Once in a Blue Moon logo will
display for a few seconds. Next a window will open with a list
of files matching the file specification you entered on the
command line, or the default. You may select a file or change
directories by using the cursor keys and the pgup and pgdn keys.
Once you have highlighted the file or directory you want press
<Ret>. If you want to abandon the program, press <Esc>.
After you have selected a file, you will be prompted for console,
printer, or file output. Simply press "c", "p" or "f" as
appropriate. If you specify file output you will be prompted for
a file name.
____________________
2 Intel and Microsoft are registered trademarks of their
respective corporations.
Once in a Blue Moon Software's Object File Dump Facility -2-
The printer option was designed for Epson FX3 or compatible
printers. For readability, the printout is in compressed form.
If there is a problem with your printout, your printer is
probably not Epson FX compatible. If you need hard copy and
don't have an Epson FX printer use the file output option.
Thenprint the file from the DOS command line with redirection
like this:
C:\>COPY OBJDUMP.TXT PRN
OBJDUMP'S OUTPUT FORMAT
The file dump will begin on screen with a prompt to continue. If
you elect to leave the program at this point simply press <Esc>.
The file dump to the printer or file is continuous. The file
dump format will look something like this:
Object File Dump Facility : C:\C\MVARSTCK.OBJ Page 1
Ofs Type Cde Lngth Record Chk ASCII
0 THEADR 80 9 07 4E 4D 41 4C 4C 4F 43 6A .NMALLOC
C LNAMES 96 1F 00 04 43 4F 44 45 04 44 41 54 41 06 10 ..CODE.DATA
44 47 52 4F 55 50 05 5F 44 41 54 41 DGROUP._DATA
05 5F 54 45 58 54 ._TEXT
2E SEGDEF 98 7 48 B2 00 06 02 01 5E H.....
38 SEGDEF 98 7 48 0C 00 05 03 01 4 H.....
42 GRPDEF 9A 4 04 FF 02 5D ...
49 EXTDEF 8C 28 06 53 54 4B 48 51 51 00 04 5F 65 6E 4E .STKHQQ.._en
64 00 09 5F 5F 61 6D 61 6C 6C 6F 63 d..__amalloc
00 0C 5F 5F 61 6D 61 6C 6C 6F 63 62 ..__amallocb
72 6B rk.
74 LEDATA A0 6 02 00 00 00 00 58 .....
7D LIDATA A2 E 02 02 00 0A 00 01 00 01 00 00 00 01 3F ............
00 .
8E LEDATA A0 B6 01 00 00 55 8B EC 8B 5E 06 0B DB 74 2D ...U...^...t
04 80 4F FE 01 8B E5 5D CB 55 8B EC ..O....].U..
56 57 BB 00 00 83 3F 00 75 29 1E 07 VW....?.u).
B8 05 00 E8 00 00 75 05 33 C0 99 EB ......u.3...
7E 40 24 FE A3 00 00 A3 00 00 96 C7 ~@$.........
04 01 00 83 C6 04 C7 44 FE FE FF 89 .......D....
36 00 00 8B 4E 06 8C D8 8E C0 E8 00 6...N.......
00 0B C0 75 56 A1 00 00 BB 00 00 80 ...uV.......
E3 FE 3B C3 74 0E 2B C3 48 48 89 07 ..;.t.+.HH..
89 1E 00 00 89 1E 00 00 B8 14 01 8B ..........
1E 00 00 8B F3 03 76 06 72 AA 03 F0 .....v.r...
72 A6 3B F4 73 A2 BE 0E 01 8B FB 03 r.;.s.......
FE 72 99 03 C7 72 95 3B C4 73 91 01 .r...r.;.s..
36 00 00 8B 07 2B C6 89 05 89 3E 00 6....+....>.
00 4E 89 37 E9 00 00 5F 5E 8B E5 5D .N.7..._^..]
CB .
____________________
3 Epson and FX are registered trademarks of Epson America
Incorporated.
Once in a Blue Moon Software's Object File Dump Facility -3-
147 FIXUPP 9C 57 C4 18 10 01 02 02 00 84 25 06 01 04 CB ........%...
C4 32 10 01 02 02 00 C4 35 10 01 02 .2......5...
04 00 C4 46 10 01 02 08 00 84 50 06 ...F......P.
01 03 C4 57 10 01 02 02 00 C4 5A 12 ...W......Z.
01 02 01 00 C4 6B 10 01 02 02 00 C4 .....k......
6F 14 01 02 C4 76 14 01 02 C4 9A 16 o....v......
01 01 C4 A4 14 01 02 84 AA 00 01 01 ............
17 00 ..
1A1 PUBDEF 90 C 00 01 05 5F 66 72 65 65 00 00 00 5D ..._free...
1B0 PUBDEF 90 E 00 01 07 5F 6D 61 6C 6C 6F 63 12 00 71 ..._malloc..
00 .
1C1 PUBDEF 90 F 01 02 08 5F 5F 61 73 65 67 64 73 02 1F ...__asegds.
00 00 ..
1D3 PUBDEF 90 E 00 01 07 5F 5F 6E 66 72 65 65 00 00 8C ...__nfree..
00 .
Object File Dump Facility : C:\C\MVARSTCK.OBJ Page 2
Ofs Type Cde Lngth Record Chk ASCII
1E4 PUBDEF 90 10 00 01 09 5F 5F 6E 6D 61 6C 6C 6F 63 A0 ...__nmalloc
12 00 00 ...
1F7 MODEND 8A 2 00
The object file format is simply a collection of variable length
records characterized by several distinct fields. The Object
File Dump Facility presents the object module as individual
records separated by their associated fields. Additional data is
added to clarify the meaning of the dump.
Each object module record is made up four basic fields. The
first is a byte indicating what type of record follows. The next
two bytes are the length of the record. The remaining
bytes(variable in length) are the actual object module data. And
the final byte is a checksum of the preceding record.
These fields are outlined by the headings at the top of each
page. All numerical entries are in hexadecimal notation. The
fields are further detailed as follows:
Ofs(offset): This is the record offset of the object file
you are dumping. The first record is always 0. This value
is not a part of the actual object file.
Type: This is the type of object record in six letter
abbreviated format, as proposed by Microsoft. The
following are the possible types supported by Microsoft and
compatible linkers, assemblers, and compilers4:
____________________
4 Microsoft Systems Journal, March 1988, "Exploring the Structure
and Contents of the MS-DOS Object Module Format", Wilton,
Richard, p 60.
Once in a Blue Moon Software's Object File Dump Facility -4-
80h THEADR Translator Header Record
88h COMMENT Comment Record
8Ah MODEND Module End Record
8Ch EXTDEF External Definition Record
8Eh TYPDEF Type Definition Record
90h PUBDEF Public Names Definition Record
94h LINNUM Line Number Record
96h LNAMES List of Names Record
98h SEGDEF Segment Definition Record
9Ah GRPDEF Group Definition Record
9Ch FIXUPP Fixup Record
A0h LEDATA Logical Enumerated Data
A2h LIDATA Logical Iterated Data
B0h COMDEF Communal Names Definition Record
The record name is not part of the actual object file, but
is derived from the first byte in the actual object record.
Cde(Code): This hexadecimal byte is the first byte in each
object record. It corresponds to the object record types
as listed in the above paragraph.
Lngth(Length): The record length is the next two bytes of
the object record. It is listed in the Object File Dump
Facility as a single hexadecimal word. However it is
stored in the usual low-order-byte-first form in the actual
object record.
Record: This is the actual object file record output in
hexadecimal format. The Object File Dump Facility lists it
in the same order it is found in the object file. This
data may be actual code or data, or it may be any one of
the data types as indicated by the 'type' field.
Chk:(CheckSum): This is the record checksum of all of the
preceding bytes in the record. It is calculated by taking
the negative(two's compliment) of each of the bytes, adding
them together and taking the modulus 100h of the result.
ASCII : This is a repeat of the data found in the record
field of the object file dump in Ascii format. Non text
bytes are coded as a period(".").
LEAVING OBJDUMP
After each page of a console file dump you will be prompted to
strike any key to continue. If you wish to exit the program,
simply press <Esc>.
At the end of the dump you will be prompted to "strike any key to
end". After this the program will end, the screen will clear and
you will be returned to DOS.
Once in a Blue Moon Software's Object File Dump Facility -5-
We hope you will find the Once in a Blue Moon Object File Dump
Facility a useful and educational tool. If you have any comments
or suggestions, send them to:
Once in a Blue Moon Software
1091 Circle Drive
Dover, DE 19901
Once in a Blue Moon Software's Object File Dump Facility -6-